package com.example.mall.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 优惠券使用记录表
 * </p>
 *
 * @author whale
 * @since 2025-05-06
 */
@TableName("tb_coupon_usage")
public class CouponUsage extends Model<CouponUsage> {

    private static final long serialVersionUID = 1L;

    /**
     * 使用记录唯一标识
     */
    @TableId("usage_id")
    private Long usageId;
    /**
     * 用户优惠券id
     */
    @TableField("user_coupon_id")
    private Long userCouponId;
    /**
     * 订单id
     */
    @TableField("order_id")
    private Long orderId;
    /**
     * 优惠金额
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;
    /**
     * 使用时间
     */
    @TableField("use_time")
    private Date useTime;
    /**
     * 状态（0-未完成，1-已完成）
     */
    private Integer status;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public CouponUsage() {
        this.usageId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getUsageId() {
        return usageId;
    }

    public void setUsageId(Long usageId) {
        this.usageId = usageId;
    }

    public Long getUserCouponId() {
        return userCouponId;
    }

    public void setUserCouponId(Long userCouponId) {
        this.userCouponId = userCouponId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public Date getUseTime() {
        return useTime;
    }

    public void setUseTime(Date useTime) {
        this.useTime = useTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    @Override
    public String toString() {
        return "CouponUsage{" +
        ", usageId=" + usageId +
        ", userCouponId=" + userCouponId +
        ", orderId=" + orderId +
        ", discountAmount=" + discountAmount +
        ", useTime=" + useTime +
        ", status=" + status +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
